<template>
	<view>
		<image v-if="loading" class="c-loading vivify popIn" src="@/static/action/loading.gif" mode="aspectFill"></image>
		<view v-else class="vivify popIn">
			<slot :useLoading="useLoading"/>
		</view>
	</view>
</template>

<script>
	export default{
		data(){
			return {
				loading:false
			}
		},
		methods:{
			useLoading(){
				this.loading=true
				return ()=>this.loading = false
			}
		}
	}
</script>

<style scoped>
	.c-loading{
		width: 45rpx;
		height: 45rpx;
	}
</style>